﻿//------------------------------------------------------------------------------------------------- 
// <copyright file="MasterPageInfo.cs" company="Collaboris Ltd.">
//   Copyright (c) Collaboris Ltd. All rights Reserved.
// </copyright>
//-------------------------------------------------------------------------------------------------
namespace Collaboris.Saf.Actions.Wss.Entities
{
    using System;
    using System.Xml.Serialization;

    using SharePoint.Wss.Attributes;
    using SharePoint.Wss.Entities;

    [CollaborisClass(
          Title = "Master Page Info",
          ReleaseStatus = ReleaseStatus.Beta,
          Summary = "Defines the parameters to set the master page on the current web.")]
    [Serializable]
    public class MasterPageInfo : WSSEntityBase
    {
        #region Fields (3) 

        private string siteMasterPageUrl;
        private string systemMasterPageUrl;
        private bool? resetSubSites;
        
        #endregion Fields 

        #region Constructors (1) 

        public MasterPageInfo() 
        {  }

        #endregion Constructors 

        #region Properties (3) 

        [CollaborisProperty(
              Summary = "Specifies the URL for the system master page URL.",
              Title = "System Master Page Url",
              Example = "/_catalogs/masterpage/BlackBand.master",
              Required = false,
              InputHint = InputHint.SingleText)]
        [XmlAttribute]
        public string SystemMasterPageUrl
        {
            get
            {
                return this.systemMasterPageUrl;
            }

            set
            {
                this.systemMasterPageUrl = value;
            }
        }

        [CollaborisProperty(
              Summary = "Specifies the URL for the site master page URL.",
              Title = "Site Master Page Url",
              Example = "/_catalogs/masterpage/BlackBand.master",
              Required = false,
              InputHint = InputHint.SingleText)]
        [XmlAttribute]
        public string SiteMasterPageUrl
        {
            get
            {
                return this.siteMasterPageUrl;
            }

            set
            {
                this.siteMasterPageUrl = value;
            }
        }

        [CollaborisProperty(
              Summary = "Specifies whether to change the master page for the sub sites that <b>do not</b> inherit from the current web site.",
              Title = "Reset Sub Sites",
              Example = "true",
              Required = false,
              InputHint = InputHint.NullableBoolean)]
        [XmlElement(IsNullable = true)]
        public bool? ResetSubSites
        {
            get
            {
                return this.resetSubSites;
            }

            set
            {
                this.resetSubSites = value;
            }
        }

       #endregion Properties 
    }
}